package com.grapevine.contact.data;

import java.util.ArrayList;
import java.util.List;

import com.grapevine.contact.db.TypeManager;

public class ContactData
{

	private long mPhoneId;

	private String mName;

	private String mUuid;

	private String mGuuid;

	private String mLastModified;

	private List<ItemData> mItemDatas;

	public String getGuuid()
	{
		return mGuuid;
	}

	public void setGuuid(String guuid)
	{
		mGuuid = guuid;
	}

	public String getLastModified()
	{
		return mLastModified;
	}

	public void setLastModified(String lastModified)
	{
		mLastModified = lastModified;
	}

	@Override
	public String toString()
	{
		return this.mName;
	}

	public String getUuid()
	{
		return mUuid;
	}

	public void setUuid(String uuid)
	{
		mUuid = uuid;
	}

	public long getPhoneId()
	{
		return mPhoneId;
	}

	public void setPhoneId(long phoneId)
	{
		mPhoneId = phoneId;
	}

	public String getName()
	{
		return mName;
	}

	public void setName(String name)
	{
		mName = name;
	}

	public List<ItemData> getItemDatas()
	{
		if (null == mItemDatas)
		{
			mItemDatas = new ArrayList<ItemData>();
		}
		return mItemDatas;
	}

	public List<Lable> getNumbers()
	{
		List<Lable> list = new ArrayList<Lable>();
		for (ItemData data : getItemDatas())
		{
			if (TypeManager.PHONE == data.getFatherType())
			{
				list.add(new Lable(data.getLable(), data.getValue()));
			}
		}
		return list;
	}

}